<div id="<%=group[:id]%>" class="group">

    <table width="100%"><tr>
        <td align="left"><%=_(group[:title]) if group[:title]%></td>
        <td><%=spinner_tag group[:spinner] if group[:spinner]%></td>
        <td align="right">
            <%if group[:tog_target]%>
            <%=link_to_remote( tog('imgup.png', group[:tog_target]),
                               { :url => {:controller => (group[:tog_url_controller]||"#{controller.controller_path}"), :action => group[:tog_url_action], :id => group[:tog_url_id] },
                                 :loading => "Element.show('#{group[:spinner]}_spinner')",
                                 :loaded => "Element.hide('#{group[:spinner]}_spinner')",
                                 :complete => group[:tog_complete_js] })%>
            <%elsif group[:tog_close_target]%>
              <%=link_to tog('imgup.png', group[:tog_close_target]),:controller => (group[:tog_url_controller]||"#{controller.controller_path}"), :action => group[:tog_url_action], :id => group[:tog_url_id]%>
            <%end%>
        </td>
    </tr></table>

    <div id="<%=group[:id]%>_list" class="grouplist" style="text-align:center;">
    <% if group[:custom_list_partial] %>
      <%=render :partial => group[:custom_list_partial], :object => group %>
    <% elsif group[:list] %>
      <ul id="<%=group[:id]%>ul">
        <%=render :partial => group[:list_partial], :collection => group[:list]%>
      </ul>
    <% end %>
    </div>

    <% if group[:form_partial] %>
       <%=render :partial => group[:form_partial], :object => group %>
    <% end %> 

    <% unless group[:help_text].blank? %>
      <div id="<%=group.id%>_help" class="grouphelp">
        <%=group[:help_text]%>
      </div>
    <% end %>

</div>

<% unless group[:custom_js].blank? %>
  <%=javascript_tag group[:custom_js]%>
<% else %>
  <%= drop_receiving_element group[:id],
      :url => { :action => group[:drop_url_action] },
      :accept => group[:drop_accept],
      :hoverclass => "droperhover" %>
<% end %>